//编程实现费式数列
public class Fee{
	//定义成员方法实现费式数列，参数由n指定1,1,2,3,5,8,13...

	//使用递归实现，当n过大时，过程复杂，耗时太长
	int show(int n){
		if (1 == n || 2 == n) return 1;
		return show(n-1) + show(n-2);
	}
	//使用递推实现
	int show1(int n){
		int ia = 1;
		int ib = 1;
		if (1  == n || 2 == n) return 1;
		for (int i = 3; i <= n ; i++ ) {
			ib = ia + ib;
			ia = ib - ia;
			
		}
		return ib;
	}
}